home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / Duck Report / _SETUP.1 / PGroup.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-08-13  |  1.1 KB  |  51 lines

  1. unit PGroup;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   DBTables, DREng, StdCtrls, DRList;
  8.  
  9. type
  10.   TFormPrintGroup = class(TForm)
  11.     DuckReport: TDuckReport;
  12.     Memo1: TMemo;
  13.     BPreview: TButton;
  14.     procedure BPreviewClick(Sender: TObject);
  15.     procedure DuckReportBeforePrintGroup(Sender: TObject; Canvas: TCanvas;
  16.       RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
  17.       StField: String);
  18.   private
  19.         clColor:        TColor;
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   FormPrintGroup: TFormPrintGroup;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30. Procedure TFormPrintGroup.BPreviewClick(Sender: TObject);
  31. Begin
  32.     clColor        := clWhite;
  33.   DuckReport.OpenFile;
  34.     DuckReport.OpenDB;
  35.     DuckReport.Preview;
  36. End;
  37. Procedure TFormPrintGroup.DuckReportBeforePrintGroup(Sender: TObject;
  38.   Canvas: TCanvas; RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
  39.   StField: String);
  40. Begin
  41.     if SectionStyle <> gtDetial Then Exit;
  42.   Canvas.Brush.Color    := clColor;
  43.   Canvas.FillRect (RcGroup);
  44.   if clColor = clWhite Then
  45.       clColor    := clSilver
  46.   Else
  47.       clColor    := clWhite;
  48. End;
  49.  
  50. End.
  51.